﻿@page
@using Volo.Abp.AspNetCore.Mvc.UI.Layout
@model YaAppoint.Web.Pages.Appointments.CheckIn.IndexModel
@inject IPageLayout PageLayout
@{
    PageLayout.Content.Title = "患者签到";
}
@section scripts
{
    <abp-script src="/js/dayjs/dayjs.min.js"></abp-script>
    <abp-script src="/Pages/Appointments/CheckIn/Index.cshtml.js"></abp-script>
    <abp-script src="/hiprint/hiprint.bundle.js"></abp-script>
    <abp-script src="/hiprint/plugins/socket.io.js"></abp-script>
}
@section styles
{
    <abp-style src ="/Pages/Appointments/CheckIn/Index.css"></abp-style>
    <abp-style src="/hiprint/css/print-lock.css"></abp-style>
    <abp-style src="/hiprint/css/hiprint.css"></abp-style>
    <abp-style src="/hiprint/css/hiprint.css" media="print"></abp-style>
}
<div class="content-container">
    <div id="app">
        <!--顶部-->
        <!--查询、高级查询-->
        <div class="filter-form-container headercontainer">
            <!--搜索栏-->
            <el-form :label-width="formLabelWidth" ref="quick-query-form">
                <el-row>
                    <el-col :span="6" style="margin-left:5px;">
                        <div class="grid-content bg-purple-dark">
                            <el-form-item label-width="0">
                                <el-input v-model.trim="number" placeholder="预约编号" size="mini" autocomplete="off" clearable></el-input>
                            </el-form-item>
                        </div>
                    </el-col>
                    <el-col :span="9" style="margin-left:5px;">
                        <div class="grid-content bg-purple-dark">
                            <el-form-item label-width="0">
                                <el-button icon="el-icon-search" type="primary" v-on:click="search" size="mini">查询</el-button>
                                <el-button v-on:click="clearSearch" size="mini">重置</el-button>
                            </el-form-item>
                        </div>
                    </el-col>
                </el-row>
            </el-form>
            <!--高级查询折叠面板-->
            <el-form :label-width="formLabelWidth" ref="advance-query-form">
                <el-collapse accordion value="advanceSearch" >
                    <el-collapse-item name="advanceSearch" title="高级搜索">
                        <div class="advance-search-container">
                            <el-row>
                                <el-col :span="6">
                                    <div class="grid-content bg-purple-dark">
                                        <el-form-item label="姓名">
                                            <el-input v-model.trim="userData.name" size="mini" autocomplete="off" clearable></el-input>
                                        </el-form-item>
                                    </div>
                                </el-col>
                                <el-col :span="6">
                                    <div class="grid-content bg-purple-dark">
                                        <el-form-item label="联系方式">
                                            <el-input v-model.trim="userData.phoneNumber" size="mini" autocomplete="off" clearable></el-input>
                                        </el-form-item>
                                    </div>
                                </el-col>
                                <el-col :span="6">
                                    <div class="grid-content bg-purple-dark">
                                        <el-form-item label="证件号码">
                                            <el-input v-model.trim="userData.idCardNumber" size="mini" autocomplete="off" clearable></el-input>
                                        </el-form-item>
                                    </div>
                                </el-col>
                                <el-col :span="6">
                                    <div class="grid-content bg-purple-dark">
                                        <el-form-item label="医保卡号">
                                            <el-input v-model.trim="userData.medicalInsuranceNumber" size="mini" autocomplete="off" clearable></el-input>
                                        </el-form-item>
                                    </div>
                                </el-col>
                            </el-row>
                            <el-row>
                                <el-col :span="6">
                                    <div class="grid-content bg-purple-dark">
                                        <el-form-item label="就诊卡号">
                                            <el-input v-model.trim="userData.medicalCardNumber" size="mini" autocomplete="off" clearable></el-input>
                                        </el-form-item>
                                    </div>
                                </el-col>
                                <el-col :span="6">
                                    <div class="grid-content bg-purple-dark">
                                        <el-form-item label="门诊号">
                                            <el-input v-model.trim="userData.outPatientNumber" size="mini" autocomplete="off" clearable></el-input>
                                        </el-form-item>
                                    </div>
                                </el-col>
                                <el-col :span="6">
                                    <div class="grid-content bg-purple-dark">
                                        <el-form-item label="住院号">
                                            <el-input v-model.trim="userData.inPatientNumber" size="mini" autocomplete="off" clearable></el-input>
                                        </el-form-item>
                                    </div>
                                </el-col>
                                <el-col :span="6">
                                    <div class="grid-content bg-purple-dark">
                                        <el-form-item label="体检号">
                                            <el-input v-model.trim="userData.physicalExamNumber" size="mini" autocomplete="off" clearable></el-input>
                                        </el-form-item>
                                    </div>
                                </el-col>
                            </el-row>
                            <el-row>
                                <el-col :span="6">
                                    <div class="grid-content bg-purple-dark">
                                        <el-form-item label="申请单号">
                                            <el-input v-model.trim="userData.applyNumber" size="mini" autocomplete="off" clearable></el-input>
                                        </el-form-item>
                                    </div>
                                </el-col>
                                    <el-col :span="12">
                                        <div class="grid-content bg-purple-dark">
                                            <el-form-item label="日期范围">
                                                <el-date-picker v-model="userData.timeRange"
                                                                type="datetimerange"
                                                                size="mini"
                                                                ref="dateRangePicker"
                                                                align="left"
                                                                format="yyyy-MM-dd "
                                                                value-format="yyyy-MM-dd HH:mm:ss"
                                                                start-placeholder="开始日期"
                                                                end-placeholder="结束日期"
                                                                :default-time="['00:00:00', '23:59:59']">
                                                </el-date-picker>
                                            </el-form-item>
                                        </div>
                                    </el-col>
                            </el-row>
                        </div>
                    </el-collapse-item>
                </el-collapse>
            </el-form>
        </div>
        <div class="container-body">
            <div class="table-container">
                <el-table :data="tableData" class="el-table" ref="appointTable" size="mini" v-on:selection-change="selectionChange">
                    <el-table-column type="selection" :selectable="getSelectable">

                    </el-table-column>
                    <el-table-column  type="expand">
                        <template slot-scope="props">
                            <div class="appoint-item-container">
                                <el-table :data="props.row.examApplies" :show-header="false" :cell-style="{ backgroundColor: '#EBEEF5' }">
                                    <el-table-column type="index">

                                    </el-table-column>
                                    <el-table-column property="examItemName" width="200" label="检查项目">

                                    </el-table-column>
                                    <el-table-column property="examItemCode" width="100" label="编号">

                                    </el-table-column>
                                    <el-table-column property="name" width="100" label="姓名">

                                    </el-table-column>
                                    <el-table-column property="examBodyPart" width="150" label="检查部位">

                                    </el-table-column>
                                    <el-table-column property="examItemFee" width="80" label="费用">

                                    </el-table-column>
                                </el-table>
                            </div>
                            
                        </template>
                    </el-table-column>
                    <el-table-column  label="编号" width="150" property="number">

                    </el-table-column>
                    <el-table-column label="姓名" width="120" property="name">
                    </el-table-column>
                    <el-table-column label="手机号" width="120" property="phoneNumber">
                    </el-table-column>
                    <el-table-column label="证件号" width="200" property="idCard">
                    </el-table-column>
                    <el-table-column label="预约信息" width="300" property="displayName">
                    </el-table-column>
                    <el-table-column label="状态" width="100">
                        <template slot-scope="scope">
                            <span v-if="scope.row.status===0" style="color:#E6A23C">未确认</span>
                            <span v-else-if="scope.row.status===1" style="color:#F56C6C">未签到</span>
                            <span v-else-if="scope.row.status===2" style="color:#409EFF">已签到</span>
                            <span v-else style="color:#909399">已取消</span>
                        </template>
                    </el-table-column>
                    <el-table-column  label="活动" width="100">
                        <template slot-scope="scope">
                            <el-switch v-model="scope.row.isActive"
                                       disabled>
                            </el-switch>
                        </template>
                    </el-table-column>
                    <el-table-column label="操作"  property="type" align="center" fixed="right">
                        <template slot-scope="scope">
                            <el-button v-if="scope.row.status===0 || scope.row.status===1" size="mini" type="primary" plain   v-on:click="singleCheckIn(scope.row.number)">签到</el-button>
                        </template>
                    </el-table-column>
                </el-table>
            </div>
        </div>
    </div>
</div>